package behavioral.visitor;

/**
 * @Description: 访问者测试类
 * @Author: lxt
 * @CreateDate: 2019/11/1
 **/
public class VisitorTest {
    public static void main(String[] args) {
        AbstractVisitor saler = new SalerVisitor();
        AbstractVisitor customer = new CustomerVisitor();

        Basket basket = new Basket();
        MeatProduct meat = new MeatProduct();
        BeerProduct beer = new BeerProduct();

        basket.addProduct(meat);
        basket.addProduct(beer);

        basket.accept(customer);
        basket.accept(saler);

    }
}
